package cheme.ProcessEditor.Figures;



import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.CompoundBorder;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;

import cheme.ProcessEditor.Figures.IDecoratable.Alignment;
import cheme.ProcessEditor.Table.ListFig;

public class AnnotationFig extends ListFig  

//extends ChemeImageFigure implements IDecoratable.IDecorator
{
	Alignment alignment = null;
	private Label index = new Label();	
	
		
	public AnnotationFig()
	{
		super();		
		//setAlignment(PositionConstants.CENTER);	
		//Animation.markBegin();
		layout.setVertical(false);
		LineBorder lnbdr = new LineBorder();
		lnbdr.setColor(ColorConstants.red);
		lnbdr.setWidth(3);
		index.setBorder(new CompoundBorder(lnbdr,
				new MarginBorder(2)));
		Font classFont = new Font(null, "Arial", 8, SWT.BOLD );
		index.setFont(classFont);
		add(index);
		initPresentation();			
	}
	public void addtoolTip(Label tooltiplabel)
	{
		add(tooltiplabel);
	}
	
	// This was used to show warning image
	public void setImage(Image img)
	{	
		//ImageFigure imgfigure = new ImageFigure(img);		
		//add(imgfigure);
	}
	
	public void setDecorationAlignment(Alignment alignment)
	{
		this.alignment = alignment;
	}
	
	public Alignment getDecorationAlignment()
	{
		if(null == alignment)
		{
			alignment = Alignment.RIGHT;
		}
		
		return alignment;
	}
	
	// sets the Feedback number to be shown inside the rectagle
	public void setIndex(String newCount) {
		index.setText(newCount);
	}
	
	public String getIndex()
	{
		String msgCount = this.index.getText();
		return msgCount;
	}
	
	public void setBackgroundColor(Color bgColor)
	{
		this.index.setOpaque(true);
		this.index.setBackgroundColor(bgColor);
		
	}
	public Color getBackGroundColor()
	{
		return (this.index.getBackgroundColor());
	}
	
}
